const defaultState = [
  {
    key: '1',
    name: '路飞',
    age: 20,
  },
  {
    key: '2',
    name: '鸣人',
    age: 21,
  },
  {
    key: '3',
    name: '小魔仙',
    age: 22,
  }

];
let newState = JSON.parse(JSON.stringify(defaultState))

let state2 = [...defaultState];

//验证第一层 解构赋值第一层 拷贝了
// console.log(defaultState === newState);
console.log(state2 === defaultState);

//验证第二层 解构赋值第二层 没拷贝
// console.log(defaultState[0] === newState[0]);
console.log(state2[0] === defaultState[0]);
// console.log(newState);

console.log(state2);
